package com.sky.mapper.common;

import com.sky.pojo.ShortUrl;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface ShortUrlMapper {

    @Insert("insert into tb_short_url_info values(null,#{shortUrl},#{fullUrl},#{shortCode},#{expireTime},#{tradeNo})")
    void save(ShortUrl shortUrlPojo);

    @Select("select * from tb_short_url_info where short_code=#{code}")
    ShortUrl selectByCode(String code);

    @Select("select * from tb_short_url_info where trade_no=#{tradeNo}")
    ShortUrl selectByTradeNo(Long tradeNo);
}
